package priv.ljh.operate.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import priv.ljh.operate.entity.Shopcar;
import priv.ljh.operate.mapper.ShopCarMapper;
import priv.ljh.operate.service.ShopCarService;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class ShopCarServiceImpl implements ShopCarService {
    @Resource
    private ShopCarMapper shopCarMapper;
    @Override
    public List<Shopcar> getAllcar(int uid) {
        return shopCarMapper.getAllcar(uid);
    }

    @Override
    public int insertCar(String title, String img_url, String sell_price, String market_price, int uid) {

        int number=1;
        return shopCarMapper.insertCar( title,  number,  img_url,  sell_price,  market_price,  uid);
    }

    @Override
    public int updateCar(int number, int sid) {
        return shopCarMapper.updateCar(number,sid);
    }

    @Override
    public int deleteCar(int sid) {
        return shopCarMapper.deleteCar(sid);
    }
}
